#include <stdlib.h>
#include <sys/types.h>
#include <pthread.h>

#ifndef ROBOLIB_H
#define ROBOLIB_H

#ifdef __cplusplus
extern "C" {
#endif

enum dev_type
{
	motor_type = 0,
	servo_type,
	buzzer_type
};

struct robo_dev
{
	char *value_file;
	enum dev_type type;
	int val1;
	int val2;
};

int setConfig(struct robo_dev *conf, size_t members);

void setMotorValue(unsigned int confNum, int value);
int getMotorValue(unsigned int confNum);

void disableServo(unsigned int confNum);
void setServoValue(unsigned int confNum, int value);
int getServoValue(unsigned int confNum);

pthread_t beep(unsigned int confNum, int frequency, int duration);

#ifdef __cplusplus
}
#endif

#endif
